home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / hexa.lha / hexa / btoh.mi next >
Text File  |  1992-08-18  |  412b  |  24 lines

  1. MODULE btoh;
  2.  
  3. (* convert binary files into ascii using hexadecimal representation *)
  4.  
  5. FROM StdIO IMPORT ReadC, EndOfFile, WriteN, WriteNl, CloseIO;
  6.  
  7. VAR count: INTEGER;
  8.  
  9. BEGIN
  10.    count := 0;
  11.    WHILE NOT EndOfFile () DO
  12.       WriteN (ORD (ReadC ()), 2, 16);
  13.       INC (count);
  14.       IF count = 40 THEN
  15.      WriteNl;
  16.      count := 0;
  17.       END;
  18.    END;
  19.    IF count # 0 THEN
  20.       WriteNl;
  21.    END;
  22.    CloseIO;
  23. END btoh.
  24.